﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QuanLyCuaHangBanMayTinh.He_Thong_Giao_Dien;
using QuanLyCuaHangBanMayTinh.He_Thong_Du_Lieu;
using QuanLyCuaHangBanMayTinh.He_Thong_Xu_Ly;


namespace QuanLyCuaHangBanMayTinh
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }

        public void Loadgiaodien(bool admin)
        {
            if (admin)
            {
                
                quảnLýNgườiDùngToolStripMenuItem.Visible = true;
            }
            else
            {
                
                quảnLýNgườiDùngToolStripMenuItem.Visible = false;
            }
        }

        private void MainForm_Load(object sender, EventArgs e)
        {

        }

        private void quảnLýToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmQuanLyNhanVien frmNhanVien = new frmQuanLyNhanVien();
            frmNhanVien.MdiParent = this;
            frmNhanVien.Show();
        }

        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            DialogResult dr = MessageBox.Show("Bạn có muốn thoát chương trình hay không?", "Thoat Chuong Trinh", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
            if (dr == DialogResult.Cancel)
            {
                e.Cancel = true;
            }
        }

        private void thoátToolStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void nhậpHàngToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmNhapHang frmNhapHang = new frmNhapHang();
            frmNhapHang.MdiParent = this;
            frmNhapHang.Show();
        }

        private void xuấtHàngToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmXuatHang frmXuatHang = new frmXuatHang();
            frmXuatHang.MdiParent = this;
            frmXuatHang.Show();
        }

        private void báoGiáToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmBaoGia frmBaoGia = new frmBaoGia();
            frmBaoGia.MdiParent = this;
            frmBaoGia.Show();
        }

        private void hóaĐơnToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmBaoHanh frmBaoHanh = new frmBaoHanh();
            frmBaoHanh.MdiParent = this;
            frmBaoHanh.Show();
        }

        private void quảnLýNgườiDùngToolStripMenuItem_Click(object sender, EventArgs e)
        {
            QuanLyNguoiDung frmNguoiDung = new QuanLyNguoiDung();
            frmNguoiDung.MdiParent = this;
            frmNguoiDung.Show();
        }

        private void báoCáoNhậpHàngToolStripMenuItem_Click(object sender, EventArgs e)
        {
            BaoCaoNhapHang bc_nhaphang = new BaoCaoNhapHang();
            bc_nhaphang.MdiParent = this;
            bc_nhaphang.Show();
        }

        private void báoCáoXuấtHàngToolStripMenuItem_Click(object sender, EventArgs e)
        {
            BaoCaoXuatHang bc_XuatHang = new BaoCaoXuatHang();
            bc_XuatHang.MdiParent = this;
            bc_XuatHang.Show();
        }
        
      
    }
}
